package cn.itnanls.util;

import java.util.Map;

/**
 * 统一的返回值
 * @author Ding
 */
public class R {
    private int code;
    private String msg;
    private Map<String,String> otherMsg;
    public int getCode() {
        return code;
    }



    public void setCode(int code) {
        this.code = code;
    }

    public Map<String, String> getOtherMsg() {
        return otherMsg;
    }

    public void setOtherMsg(Map<String, String> otherMsg) {
        this.otherMsg = otherMsg;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public R(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }
    public static R of(ResultCode resultCode){
      return new R(resultCode.getCode(),resultCode.getMsg());
    }
}
